package com.bknow.model;

import java.io.Serializable;
import java.util.List;

public class PageBean<T> extends ResultBean<T> implements Serializable {

	private int page;// 第几页

	private int limit;// 每页显示的记录数
	
	private int start;// 起始记录数
	
	private int total;//数据总记录数
	
	private T products;
	
	public PageBean(int page, int limit) {
		super();
		this.page = page;
		this.limit = limit;

	}
	public PageBean(Integer status, String msg, List<T> data,int total,int limit) {
		super.setStatus(status);
		super.setMsg(msg);
		this.total=total;
		this.limit=limit;
	}
	
	public T getProducts() {
		return products;
	}
	public void setProducts(T products) {
		this.products = products;
	}
	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getStart() {
		return (page - 1) * limit;
	}

	public void setStart(int start) {
		this.start = start;
	}
	
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}
	
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	@Override
	public String toString() {
		return "PageBean [page=" + page + ", limit=" + limit + ", start=" + start + ", total=" + total + ",status=" + super.getStatus() + ", msg=" + super.getMsg() + ", data=" + super.getData()+ "]";
//		return "ResultBean [status=" + super.getStatus() + ", msg=" + super.getMsg() + ", data=" + data + "]";
	}

	
}
